// pages/test/home/home.js
Page({

  data: {
    scdata: [{ scrollTop: 0 }, { scrollTop: 0 }, { scrollTop: 0 }, { scrollTop: 0 }, { scrollTop: 0 }, { scrollTop: 0 }, { scrollTop: 0 }, { scrollTop: 0 }, { scrollTop: 0 }, { scrollTop: 0 }]
  },
  onLoad(){
    this.queryMultipleNodes()
  },
  bindscrollFun(res){
    console.log(res)
    let that = this
    that.setData({
      scrollToTop: res.detail.scrollTop,
      scrollToLeft: res.detail.scrollLeft
    })
  },
  queryMultipleNodes: function () {
    var that = this;
    var aboutArr = [];
    wx.createSelectorQuery().selectAll('.w-scview-view').boundingClientRect(function (rects) {
      console.log(rects.top)
      rects.forEach(function (rect) {
        console.log(rect.bottom);// 节点的下边界坐标
        aboutArr.push(rect.bottom);
      })
      console.log(aboutArr);
      that.setData({
        aboutArr: aboutArr
      })
    }).exec();
  }
})